package com.ktjiaoyu.crm.controller;

import com.ktjiaoyu.crm.pojo.Role;
import com.ktjiaoyu.crm.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class RoleController {

    @Autowired
    private RoleService roleService;


    /**
     * 获取所有角色信息
     * @return
     */
    @RequestMapping(value = "/role/json")
    @ResponseBody
    public List<Role> findAllRoles(){

        //查询所有角色信息
        List<Role> roles = roleService.findAllRoles();

        return roles;
    }

}
